<template>
  <div>
    <header class="saveddtextBox">
      <van-row>
        <van-col class="saveMarginTop" span="24">
          <van-row class="saveAddtextBox">
            <van-col @click="addAdderssReturn">
              <van-icon name="arrow-left" size="40" />
            </van-col>
            <van-col> 选择收货地址 </van-col>
          </van-row>
        </van-col>
      </van-row>
    </header>
    <section style="margin-top: 80px"></section>
    <section>
      <van-row class="savecontentBox">
        <van-col>
          <van-address-list
            v-model="chosenAddressId"
            add-button-text="+添加收货地址"
            :list="list"
            @add="onAdd"
            @edit="onEdit"
          />
        </van-col>
      </van-row>
    </section>
  </div>
</template>

<script>
export default {
  data() {
    return {
      chosenAddressId: "1",
      list: [
        {
          id: "1",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: true,
        },
        {
          id: "2",
          name: "李四",
          tel: "1310000000",
          address: "浙江省杭州市拱墅区莫干山路 50 号",
        },
      ],
    };
  },
  methods: {
    addAdderssReturn() {
      this.$router.back();
    },

    modificationAddrss() {
      this.$router.push("/addAdderss");
    },
    onAdd() {
      this.modificationAddrss();
      //   Toast("新增地址");
    },
    onEdit(item, index) {
      this.modificationAddrss();
      //   Toast("编辑地址:" + index);
    },
  },
};
</script>

<style>
.saveddtextBox {
  position: fixed;
  top: 0;
  width: 100%;
  height: 35px;
  background-color: #4bd863;
  z-index: 9999;
  padding: 10px 0;
}
.saveMarginTop {
  /* margin-top: 35px; */
}
.saveAddtextBox {
  height: 50px;
  line-height: 40px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.savecontentBox button {
  background-color: #4bd863;
  border: #4bd863;
  margin-bottom: 40px;
}
</style>